import React from 'react';
import { history } from 'umi';
type Props = {};
import '../work.css';
import axios from 'axios';

export default function work2({}: Props) {
  let data = history.location.state;
  // console.log(data, 'history');
  return (
    <div className="text_box_p">
      <div className="text_box">
        <div className="text_box_top">
          <div className="text_box_title">{data.title}</div>
          <div className="text_box_publish">发布时间：{data.publish}</div>
        </div>
        <div className="text_box_content">
          {data.content.map((item, index) => {
            if (item.slice(0, 5) === 'https') {
              // console.log(item,'item456')
              return (
                <p style={{ textAlign: 'center' }}>
                  <img src={item} alt="" />
                </p>
              );
            }

            return <p key={index}>{item}</p>;
          })}

          {/* 右下角署名 */}
          {/* {data.content_right.map((item, index) => {
            return (
              <p key={index} className="text_box_content_bottom">
                {item}
              </p>
            );
          })} */}
        </div>
      </div>
    </div>
  );
}
